package com.graduation.smartparkingplatform.Response;

import java.io.Serializable;

public class Response<T> implements Serializable {

  private String code;

  private String msg;

  private T data;

  public Response(String code, String msg, T data) {
    this.code = code;
    this.msg = msg;
    this.data = data;
  }

  public Response(String code, String msg) {
    this.code = code;
    this.msg = msg;
  }

  public Response(ResultEnums resultEnums) {
    this.code = resultEnums.getCode();
    this.msg = resultEnums.getMsg();
  }

  public Response(ResultEnums resultEnums, T data) {
    this.code = resultEnums.getCode();
    this.msg = resultEnums.getMsg();
    this.data = data;
  }

  public Response() {}

  public String getCode() {
    return code;
  }

  public void setCode(String code) {
    this.code = code;
  }

  public String getMsg() {
    return msg;
  }

  public void setMsg(String msg) {
    this.msg = msg;
  }

  public T getData() {
    return data;
  }

  public void setData(T data) {
    this.data = data;
  }
}
